<?php

namespace app\common\model;

class AiImage extends BaseModel
{
    protected $append = ['cdn_url'];
    public function getCdnUrlAttr($value,$data)
    {
        $domain = cache('config')['ali_oss_domain'];
        if ($data['store'] == 'local') $domain = request()->domain();
        return $domain . $data['path'];
    }
}